<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../../stylesheets/lyjNav.css">
    <link rel="stylesheet" href="../../stylesheets/reset.css">
    <link rel="stylesheet" href="../../stylesheets/person-center/six-index.css">
    <link rel="stylesheet" href="../../stylesheets/person-center/personal data.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1512981_b3gt4rwbf0t.css">
    <title>personal data</title>
    <style>
    </style>
</head>

<body>
    <!-- 头部 -->
    <div id="lxcbox">
        <div id="lxcheader"></div>
        <div id="lxcsearch"></div>
    </div>
    <div class="navwrap clear">
        <div id="nav"></div>
        <div class="tradecate"></div>
    </div>
    <div class="clear" id="six-zhu">
        <iframe src="/lwb/left" frameborder="0" id="six-if2" scrolling="no"></iframe>
        <div id="six-right">
            <div id="six-right-1">
                <span class="six-person">个人资料</span>
            </div>
            <div id="six-right-2">
                <div class="six-dangqian">
                    <div class="six-now"><span>当前头像：</span></div>
                    <div class="six-xiangpian"><img class="six-touxiang" src="../../images/person-center/touxiang.png"
                            alt=""></div>
                    <div class="six-gai"><span>修改</span></div>
                </div>
                <form action="" method="GET" target="_blank" class="six-neirong">
                    <span>昵称：</span><span class="six-mingzi">
                        <!-- <input type="text" name="Nickname" value="13012341234" id="six-nicheng"> -->
                    </span>
                    <br>
                    <span>性别：</span>
                    <input type="radio" checked="checked" name="sex" value="男" id="six-nan"><span
                        class="six-boy">男</span>
                    <input type="radio" name="sex" value="女" id="six-nv"><span class="six-girl">女</span>
                    <br>
                    <span>生日：</span>
                    <!-- <select name="年" id="six-xiala">
                        <option value="1997" class="six-year">1997</option>
                    </select> -->
                    <input type="text" id="six-xiala" class="six-year" value="">
                    <span>年</span>
                    <!-- <select name="月" id="six-xiala">
                        <option value="12" class="month">12</option>
                    </select> -->
                    <input type="text" id="six-xiala" class="six-month" value="">
                    <span>月</span>
                    <!-- <select name="日" id="six-xiala">
                        <option value="5" class="day">5</option>
                    </select> -->
                    <input type="text" id="six-xiala" class="six-day" value="">
                    <span>日</span>
                    <br>
                    <span>手机：</span><span class="six-shoujihao">
                        <!-- <input type="number" name="cell-phone" id="six-genghuan" value="13012341234"> -->
                    </span><span class="six-huanshouji">更换手机</span>
                </form>
                <div class="six-queren"><span class="six-queshi">确认提交</span></div>
            </div>
        </div>
    </div>
    <!-- 尾部 -->
    <div id="lxcfooter">
        <div id="lxcfooter1"></div>
        <div id="lxcfooter2"></div>
        <div id="lxcbottom"></div>
    </div>
</body>
<script src="../../javascripts/jquery-3.4.1.min.js"></script>
<script src="../../javascripts/lxcheader.js"></script>
<script src="../../javascripts/lyjNav.js"></script>
<script>
    $('.six-queshi').click(function () {
        location.href = '/lwb/myaccount'
    })
    $('.six-huanshouji').click(function () {
        location.href = '/lwb/huanbang1'
    })
    $.ajax({
        url: "http://localhost:8080/lwb/liulang",
        type: 'post',
        data: {
            id: '10',
        },
        dataType: 'json',
        success: (data) => {
            console.log(data);
            var str = '1997-12-05T16:00:00.000Z';
            var arr = str.split('T');
            $('.six-year').val(arr[0].split('-')[0]);
            $('.six-month').val(arr[0].split('-')[1]);
            $('.six-day').val(arr[0].split('-')[2]);
            // console.log(arr[0].split('-')[0],arr[0].split('-')[1],arr[0].split('-')[2]);
            $('.six-xiangpian').empty();
            $('.six-mingzi').empty();
            $('.six-shoujihao').empty();
            if (data.code == '1') {
                for (let i in data.result) {
                    $('.six-xiangpian').append('<img class="six-touxiang" src="' + data.result[i].imgSrc + '" alt=""></div>')
                }
                for (let j in data.result) {
                    $('.six-mingzi').append('<input type="text" name="Nickname" value="' + data.result[j].userName + '" id="six-nicheng">')
                }
                for (let k in data.result) {
                    $('.six-shoujihao').append('<input type="number" name="cell-phone" id="six-genghuan" value="'+ data.result[k].tel +'">')
                }
            }
        },
    })

    $('.six-queshi').click(function () {
        $.ajax({
            url: "http://localhost:8080/lwb/llang",
            type: 'post',
            data: {
                id: localStorage.getItem('userID'),
                imgSrc: '../../images/person-center/touxiang.png',
                userName: $('#six-nicheng').val(),
                tel: $('#six-genghuan').val(),
                birdthDay: $('.six-year').val() + "-" + $('.six-month').val() +"-"+ $('.six-day').val()
            },
            dataType: 'json',
            success: (data) => {
                console.log(data);
            },
        })
    })
</script>

</html>